// src/main.js
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: function (h) { return h(App) }
}).$mount('#app')

// 初始化购物车数据
store.dispatch('addItem', { id: 1, name: '手机', price: 1000, quantity: 1 });
store.dispatch('addItem', { id: 2, name: '电脑', price: 2000, quantity: 1 });
store.dispatch('addItem', { id: 3, name: '键盘', price: 200, quantity: 2 });